{% extends "mainPage.html" %}

{% block main_body %}
  <div id="main_body">
    <fieldset class="Web_Operation" style="margin-top: 20px;">
      <legend>定时任务操作</legend>
      <form class="form" id="log-form" action="/data_encode" method="POST">
          <div>
              <input type="button" value="启动定时任务" id="start_job" class="button_class"/>
              <input type="button" value="停止定时任务" id="end_job" class="button_class"/>
              <input type="button" value="查看操作日志" id="query_locallog" class="button_class"/>
          </div>
          <p style="left: 30px">
              <textarea id="add_info" name="content" style="width: 400px;height: 40px;margin-left: 30px">
                  {% if content %}
                      {{ content }}
                  {% endif %}
              </textarea>
          </p>
      </form>
    </fieldset>
  </div>
  <div id="sec_body">
      <fieldset class="Web_Operation" style="margin-top: 10px; height: 600px">
          <legend>JIRA消息通知定时任务配置</legend>
          <form method="post" enctype="multipart/form-data" action="/job/jira_job/">
              {% csrf_token %}
              <div class="row_edit">
                  <input type="submit" value="查看任务信息" id="get_config" class="button_class"/>
                  <select name="job_type" class="select">
                      <option value="query_jira_info">JIRA任务</option>
                      <option value="0">删除任务</option>
                  </select>
                  <select name="job_id" class="select">
                      <option value="0">--查看帮助文档--</option>
                      <option value="1">--新增--</option>
                      {% for sp in job_id %}
                          <option value="{{ sp }}">{{ sp }}</option>
                      {% endfor %}
                  </select>
              </div>
          </form>
          <h3>--------------------------------------配置任务信息-----------------------------------------------------</h3>
          <form method="post" enctype="multipart/form-data" action="/job/modify_job/">
              {% csrf_token %}
              <p>
                  <h4 style="width: 600px;display: inline;">任务序号:</h4>
                  <input type="text" value="{{dic_res.id}}" id="job_id" name="job_id"
                         style="width: 150px;height: 20px" class="jon_info"/>
              </p>
              <p>
                  <h4 class="title_name">任务类型:</h4>
                  <input type="text" value="query_jira_info" id="job_type" name="job_type" readonly="true"
                         style="width: 150px;height: 20px" class="jon_info"/>
              </p>
              <p>
                  <h4 class="title_name">是否启用:</h4>
                  <select name="start_flag" id="start_flag" value="{{dic_res.is_update}}" style="width: 100px;height: 25px">
                      <option value="1">True</option>
                      <option value="0">False</option>
                  </select>
              </p>
              <p>
                  <h4 class="title_name">触发时间:</h4>
                  <input type="text" value="{{dic_res.corn_time.days}}" name="time_fre" id="time_fre" class="jon_info"
                         style="width: 70px;height: 20px" placeholder="Fre：0-4"/>
                  <input type="text" value="{{dic_res.corn_time.hour}}" name="job_time_h" id="job_time_h" class="jon_info"
                         style="width: 50px;height: 20px" placeholder="Hour:9"/>
                  <input type="text" value="{{dic_res.corn_time.minute}}" name="job_time_m" id="job_time_m" class="jon_info"
                         style="width: 50px;height: 20px" placeholder="Min：50"/>
              </p>
              <div>
                  <p>
                      <h4 style="width: 600px;display: inline;">登陆账号:</h4>
                      <input type="text" value="{{dic_res.params.jira_login.username}}" id="jira_name" name="jira_name"
                             style="width: 150px;height: 20px" class="jon_info" placeholder="JIRA登陆账号"/>
                  </p>
                  <p>
                      <h4 style="width: 600px;display: inline;">登陆密码:</h4>
                      <input type="password" value="{{dic_res.password}}" id="jira_pw" name="jira_pw"
                             style="width: 150px;height: 20px" class="jon_info" placeholder="JIRA登陆密码"/>
                  </p>
                  <p>
                      <h4 style="width: 600px;display: inline;">JIRA主页:</h4>
                      <input type="text" value="https://hs-cas.hundsun.com/cas/login?service=https%3A%2F%2Fse.hundsun.com%2Fsecure%2FDashboard.jspa"
                             id="jira_url" name="jira_url" readonly="true" style="width: 800px;height: 20px" class="jon_info"/>
                  </p>
              </div>
              <div>
                  <p>
                      <h4 class="title_name">JIRA条件:</h4>
                      <input type="text" value="{{dic_res.params.jsql}}" name="job_jira" id="job_jira" class="jon_info"
                             style="width: 800px;height: 20px" placeholder="JIRA我的报告，勾上筛选条件，切换高级拷贝查询语句。报告人不要勾选，会自动拼接"/>
                  </p>
                  <p>
                      <h4 class="title_name">钉钉URL:</h4>
                      <input type="text" value="{{dic_res.params.dd_info.dd_url}}" name="job_dd_url" id="job_dd_url" class="jon_info"
                             style="width: 800px;height: 20px" placeholder="钉钉群机器人的webhook"/>
                  </p>
                  <p>
                      <h4 class="title_name">提示消息:</h4>
                      <input type="text" value="{{dic_res.params.dd_info.dd_tip}}" name="job_dd_tip" id="job_dd_tip" class="jon_info"
                             style="width: 800px;height: 20px" placeholder="钉钉群机器人的自定义提醒消息，例如:'缺陷已修复，请及时验证'"/>
                  </p>
                  <p>
                      <h4 class="title_name">人员列表:</h4>
                      <a href="./static/files/ModuleFileList.csv" download="ModuleFileList.csv">下载钉钉群人员列表_填写模板:《ModuleFileList.csv》</a>
                      <input type="file" name="module_file" style="width: 400px;height: 25px;left: 30px">
                  </p>

              </div>
              <p>
                  <input type="submit" value="添加/修改" class="button_class">
                  <h4 style="white-space: pre">
                      {% if res_content %}
                          {{res_content}}
                      {% endif %}
                  </h4>
              </p>
          </form>
      </fieldset>
  </div>
{% endblock %}

